﻿@{
    var current = ViewBag.CurrentNav as string;
}
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar" style="margin-top:20px;">
        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu" id="sidebar-menu">
            @Html.Raw(ViewBag.NavBar)            
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>
<script>
    var menuVal = "@current";
    if ("" != menuVal.trim() && typeof menuVal != undefined) {
        var currentMenu = document.getElementById(menuVal);
        document.getElementById("sidebar-menu").querySelectorAll("li.treeview").className = "treeview";
        document.getElementById("sidebar-menu").querySelectorAll("ul.treeview-menu>li").className = "";
        currentMenu.setAttribute("class", "treeview active");
        var parent = currentMenu.parentNode;
        if (parent && parent.id != "sidebar-menu") {
            currentMenu.parentNode.parentNode.setAttribute("class", "treeview active noactive");
        }
    }

    //function setCookie(c_name, value, expireMinutes) {
    //    var exdate = new Date()
    //    exdate.setHours(exdate.getMinutes() + expireMinutes)
    //    document.cookie = c_name + "=" + escape(value) +
    //    ((expireMinutes == null) ? "" : ";expires=" + exdate.toGMTString())
    //}

    //function getCookie(c_name) {
    //    if (document.cookie.length > 0) {
    //        c_start = document.cookie.indexOf(c_name + "=")
    //        if (c_start != -1) {
    //            c_start = c_start + c_name.length + 1
    //            c_end = document.cookie.indexOf(";", c_start)
    //            if (c_end == -1) c_end = document.cookie.length
    //            return unescape(document.cookie.substring(c_start, c_end))
    //        }
    //    }
    //    return ""
    //}
</script>


